import request from '../../utils/school-teacher/request.js'

export function addTeacher(teacher) {
  return request({
    url: 'schoolTeacher/addTeacher',
    method: 'post',
    data: teacher
  })
}

export function updateTeacher(teacherId, params) {
  return request({
    url: 'schoolTeacher/updateTeacher',
    method: 'post',
    params: { teacherId }, // 路径参数：教师工号
    data: params           // 需更新的字段
  })
}

export function deleteTeacher(teacherId) {
  return request({
    url: 'schoolTeacher/deleteTeacher',
    method: 'post',
    params: { teacherId }
  })
}

export function getAllTeacherBySchoolId(schoolNum) {
  return request({
    url: 'schoolTeacher/getAllTeacherBySchoolId',
    method: 'post',
    params: { schoolNum: schoolNum }
  })
}